<?php
/**
 * Created by PhpStorm.
 * User: dancheng
 * Date: 2018/1/18
 * Time: 12:00
 */
class Img extends CI_Controller{
    public $token_data;
    /**
     * Img constructor.
     * 构造函数，导入url辅助类
     */
    public function __construct(){
        parent::__construct();
        $this->token_data = check_token($this);
    }

    /**
     * 主页
     */
    public function index(){$this->load->view('img/images');}

    /**
     * 拟json接收测试
     */
    public function test(){
        //如果访问合法便进行数据操纵
        if($this->token_data['tag']){
            $data = [
                'name'  => 'dancheng',
                'age'   => 21,
                'width' => 190,
            ];
            $this->token_data['data'] = $data;
        }
        $json = json_encode($this->token_data);
        echo $json;
    }
}